package chapter6;
/****************************************************************
 * Author：icynlau
 * Description: 计算一年的天数
 * Date:2021/4/4
 * ***************************************************************
 */
public class exc6_16 {
	
	public static int numberOfDaysInAYear(int year) {
		
		if(year%4==0&&year%100!=0||year%400==0) {
			
			return 366;
			
		}
		
		return 365;
		
	}
	
	public static void main(String[]  args) {
		
		
		for(int i=2000;i<=2020;i++) {
			
			System.out.printf("%d   has   %d  days\n", i,numberOfDaysInAYear(i));
			
		}
		
	}

}
